package com.aaa.ssm.controller;

import com.aaa.ssm.entity.Dicgchannel;
import com.aaa.ssm.entity.TDicNechannel;
import com.aaa.ssm.service.NechannlServiel;
import com.aaa.ssm.util.Page;
import com.aaa.ssm.util.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@RestController
@RequestMapping("nechannl")
public class NechannlController extends BaseController {
    @Resource
    private NechannlServiel nechannlServiel;

    /**
     * 分页带参查询
     * @param tDicNechannelPage
     * @return
     */
    @PostMapping("queryAll")
    public Result queryAll(@RequestBody Page<TDicNechannel> tDicNechannelPage){
        return success(nechannlServiel.queryAll(tDicNechannelPage));
    }
    @PostMapping("add")
    public Result add(@RequestBody Dicgchannel dicgchannel) {
        return success(nechannlServiel.add(dicgchannel));
    }
    @PostMapping("update")
    public Result update(@RequestBody Dicgchannel dicgchannel) {
        return success(nechannlServiel.update(dicgchannel));
    }
    @DeleteMapping("delete/{code}")
    public Result delete(@PathVariable("code") String code) {
        return success(nechannlServiel.delete(code));
    }
}
